//
//  CDVGetBeaconLocate.m
//  post
//
//  Created by jing zhao on 9/24/14.
//  Copyright (c) 2014 jing zhao. All rights reserved.

#import "CDVMedia.h"
#import <MediaPlayer/MediaPlayer.h>

@interface CDVMedia ()
@property (strong, nonatomic)CDVInvokedUrlCommand*  command;
@end


@implementation CDVMedia

- (void)presentMediaMp4:(CDVInvokedUrlCommand*)command
{
       NSString *strPath = [command.arguments objectAtIndex:0];
       MPMoviePlayerViewController *moviePlayer = [[MPMoviePlayerViewController alloc]initWithContentURL:[NSURL URLWithString:strPath]];
      [self.viewController presentMoviePlayerViewControllerAnimated:moviePlayer];
      CDVPluginResult*  pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:@"success"];
      [self.commandDelegate sendPluginResult:pluginResult
                                    callbackId:command.callbackId];


}

@end
